<div class="ordertypes view">
<h2><?php  __('Ordertype');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $ordertype['Ordertype']['id']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Name'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $ordertype['Ordertype']['name']; ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Edit Ordertype', true), array('action' => 'edit', $ordertype['Ordertype']['id'])); ?> </li>
		<li><?php echo $html->link(__('Delete Ordertype', true), array('action' => 'delete', $ordertype['Ordertype']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $ordertype['Ordertype']['id'])); ?> </li>
		<li><?php echo $html->link(__('List Ordertypes', true), array('action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Ordertype', true), array('action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Orders', true), array('controller' => 'orders', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Order', true), array('controller' => 'orders', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php __('Related Orders');?></h3>
	<?php if (!empty($ordertype['Order'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Id'); ?></th>
		<th><?php __('Division Id'); ?></th>
		<th><?php __('Ordertype Id'); ?></th>
		<th><?php __('Number'); ?></th>
		<th><?php __('Date'); ?></th>
		<th><?php __('Document Text'); ?></th>
		<th><?php __('Student Ids'); ?></th>
		<th><?php __('Author'); ?></th>
		<th><?php __('Approved'); ?></th>
		<th><?php __('Info'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($ordertype['Order'] as $order):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $order['id'];?></td>
			<td><?php echo $order['division_id'];?></td>
			<td><?php echo $order['ordertype_id'];?></td>
			<td><?php echo $order['number'];?></td>
			<td><?php echo $order['date'];?></td>
			<td><?php echo $order['document_text'];?></td>
			<td><?php echo $order['student_ids'];?></td>
			<td><?php echo $order['author'];?></td>
			<td><?php echo $order['approved'];?></td>
			<td><?php echo $order['info'];?></td>
			<td class="actions">
				<?php echo $html->link(__('View', true), array('controller' => 'orders', 'action' => 'view', $order['id'])); ?>
				<?php echo $html->link(__('Edit', true), array('controller' => 'orders', 'action' => 'edit', $order['id'])); ?>
				<?php echo $html->link(__('Delete', true), array('controller' => 'orders', 'action' => 'delete', $order['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $order['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link(__('New Order', true), array('controller' => 'orders', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
